import request from '@/utils/request'

// 查询边管理-中间件列表
export function listManageEdgeMiddleware(query) {
  return request({
    url: '/manager/manageEdgeMiddleware/list',
    method: 'get',
    params: query
  })
}


export function listStatusManageMiddleware(query) {
  return request({
    url: '/manager/manageEdgeMiddleware/statusList',
    method: 'get',
    params: query
  })
}

// 查询边管理-中间件详细
export function getManageEdgeMiddleware(middlewareId) {
  return request({
    url: '/manager/manageEdgeMiddleware/getInfo/' + middlewareId,
    method: 'get'
  })
}

// 新增边管理-中间件
export function addManageEdgeMiddleware(data) {
  return request({
    url: '/manager/manageEdgeMiddleware/add',
    method: 'post',
    data: data
  })
}

// 修改边管理-中间件
export function updateManageEdgeMiddleware(data) {
  return request({
    url: '/manager/manageEdgeMiddleware/edit',
    method: 'post',
    data: data
  })
}

// 删除边管理-中间件
export function delManageEdgeMiddleware(middlewareId) {
  return request({
    url: '/manager/manageEdgeMiddleware/remove/' + middlewareId,
    method: 'get'
  })
}

// 部署边管理-中间件
export function deployManageEdgeMiddleware(middlewareId) {
  return request({
    url: '/manager/manageEdgeMiddleware/deploy/' + middlewareId,
    method: 'get',
    timeout: 60000
  })
}

export function getConnectStatus(data) {
  return request({
    url: '/manager/manageEdgeMiddleware/getConnectStatus',
    method: 'get',
    params: data
  })
}

export function clearInfluxDb(data) {
  return request({
    url: '/manager/manageEdgeMiddleware/clearInfluxDb',
    method: 'post',
    data: data
  })
}

export function getConnectStatusById(middlewareId) {
  return request({
    url: '/manager/manageEdgeMiddleware/getConnectStatusById/' + middlewareId,
    method: 'get'
  })
}